package layer_model;

import java.util.List;

import dto.Sample;

public class CascadeLayerModel implements LayerModel {
	private int n;
	
	@Override
	public int test(Sample sample) {
		int k = 0;
		int [] layer = sample.getLayers();
		for(; k < layer.length; k++) {
			if(layer[k] == 0) {
				break;
			}
		}
		return k;
	}

	@Override
	public void train(List<Sample> samples) {
		n = samples.get(0).getLayers().length;
	}

	@Override
	public String dump() {
		StringBuilder sb = new StringBuilder();
		for(int i = 0; i < n; i++) {
			sb.append(i + " ");
		}
		return sb.toString().trim();
	}
}
